package com.lihepeng.leecode.juc;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * 测试 原子类
 */
public class AtomicIntegerDemo {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(5);
        boolean b = atomicInteger.compareAndSet(5, 2019);
        atomicInteger.incrementAndGet();
        System.out.println("now:"+atomicInteger.get());
    }
}
